package cn.legend.travel.guide.dao.persist.repository.impl;

import cn.legend.travel.guide.dao.persist.mapper.GuideDetailMapper;
import cn.legend.travel.guide.dao.persist.repository.IGuideDetailRepository;
import cn.legend.travel.guide.pojo.po.GuideDetailPO;
import cn.legend.travel.guide.pojo.vo.GuideDetailCommentVO;
import cn.legend.travel.guide.pojo.vo.GuideDetailVO;
import cn.legend.travel.guide.util.GuideDetailPOToGuideDetailVOConvertor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class GuideDetailRepositoryImpl implements IGuideDetailRepository {
    @Autowired
    private GuideDetailMapper guideDetailMapper;

    @Override
    public GuideDetailVO getGuideDetailById(Long guideId) {
        GuideDetailPO guideDetailPO = guideDetailMapper.getGuideDetailById(guideId);
        return GuideDetailPOToGuideDetailVOConvertor.convert(guideDetailPO);
    }

    @Override
    public List<GuideDetailCommentVO> getGuideDetailCommentByGuideId(Long guideId) {
        return guideDetailMapper.getGuideDetailCommentByGuideId(guideId) ;
    }
}
